1. Field of the Invention
The method of the present invention provides a mechanism that enables OLE DB (Object Linking and Embedding Database) applications to access columns present in index structures without accessing the base table.
2. Description of Related Art
The Unisys Enterprise Database Server for ClearPath MCP (a.k.a. DMSII) consists of Tables and Indexes. MCP refers to Unisys Master Control Program. Indexes permit database applications to rapidly retrieve rows based on search criteria. Additionally, indexes permit relationships to be maintained between rows of the table. The most commonly used relationship is row ordering based on certain columns in the table known as key columns. Thus, indexes allow rapid random retrieval and ordered sequential retrieval. DMSII indexes are non-clustered, i.e. a separate disk file contains the index entries and pointers (or row addresses) to base table rows. Therefore, to fetch a row from a table via an index, at least two disk reads must be executed: (i) to fetch the block that contains the index entry from the index file and (ii) to fetch the block containing the row from the table file.
However, there are many occasions when user applications would just want to count the number of rows in a table or retrieve columns that are stored in index structures. In addition, DMSII databases also allow frequently used non-key columns (known as key-data columns) to be stored in the index structure. Since index structures are much smaller in size when compared to the base table, they allow for rapid traversal and data retrieval.
The prior art software did not detect various data access patterns, which could facilitate usage of the index for data retrieval. In particular, if the application only retrieves data from columns that are stored in the index structure, then those columns could be retrieved solely from the index. This avoids I/O operations on the base table rows and its attendant effects on database performance.
It is therefore important to have a system, which provides a mechanism that enables OLE DB applications to access columns present in index structures without accessing the base table, as the method of the present invention does.
One related art method to which the method of the present invention generally relates is described in U.S. Pat. No. 6,246,410, entitled “Method and System For Database Access”. This related art method is a method and system for accessing the contents of a database from an OLE enabled user application without requiring the database to be open on the users desktop or requiring the user to know a text based data manipulation language. That is, using OLE's drag and drop methodology, a user may search the contents of a database to generate a result set of rows from the database and utilize information content from the resulting rows as desired. An OLE enabled user application is opened on a user's computer. The user then selects the location of a database to be accessed using a dialogue. Once the desired database is located, a “palette” is created at a portion of the screen of the user's computer. Once the palette is created, the user then searches and accesses the contents of the database by using drag and drop gestures in conjunction with the OLE enabled user application and the established palette.
The present invention differs from the above prior cited art in that the prior invention, provides a general method of accessing a database from a Windows based OLE application. It is not clear whether it uses OLE DB or some other data access mechanism to obtain data from the backend database. However, the method of the present invention focuses on the cases where database queries fetch a limited set of columns from a table. The current invention also checks whether the query fetches columns which are present in an index spanning the table and, if so, issues database fetch requests from only the index structure which is much more efficient than obtaining the whole row from the base table.
Another related art method to which the method of the present invention generally relates is described in U.S. Pat. No. 5,760,770 entitled “System and Method For Defining A View To Display Data”. This related art method includes views and view controls which are used to display and access data created from multiple applications. Namespaces, folders, items, views and view control objects are used to abstract the data type of the data, contained in items. Therefore, data can be displayed in multiple views and the same view can be used to display data independent of the data type. To display a view, a user selects a folder that contains items. A folder, item, view, and view control work together to define the fields and data to display and the format to display them. The user can generate many views by editing one view, thereby creating a new view. An edit interface is provided allowing the user to modify a view. Modifications include entering new data in a view, defining new fields, and entering calculations based on other data. A new view control can be installed by determining what information to pass, conforming to OLE standards and entering the view control in the operating system's database registry.
The present invention differs from the above prior cited art in that the prior invention, does not deal with database queries from an OLE DB application and is therefore unrelated to the current invention.